<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title><%= article.title %> - WDShare</title>
<meta name="keywords" content="<%= article.tag %>" />
<meta name="description" content="<%= article.description %>" />
<% include ../../etc/htmlhead.ejs %>

<% if (!article.editorModel) { %>
<link href="/static/ueditor/third-party/SyntaxHighlighter/shCoreSublime.css" rel="stylesheet" />
<script src="/static/ueditor/third-party/SyntaxHighlighter/shCore.js"></script>
<script type="text/javascript">
  /* ueditor 代码高亮 */
  SyntaxHighlighter.all();
</script>
<% } %>
<% if (article.editorModel == 'markdown') { %>
<link rel="stylesheet" href="/static/plugin/editor.md/examples/css/style.css" />
<link rel="stylesheet" href="/static/plugin/editor.md/css/editormd.preview.css" />
<link rel="stylesheet" href="/static/skin2015/css/markdown-correction.css" />
<% } %>
</head>

<body>
<% include ../../etc/head.ejs %>

<% include ../../etc/article-head-ad.ejs %>


<input id="js-archives-id" type="hidden" value="<%= article._id %>" />
<input id="js-archives-model" type="hidden" value="article" />
<div class="article">
  <div class="maxWidth module">
    <% if ( !article.audit ) { %>
    <div class="inform" style="padding:0 0 40px;">
      <p class="inform-con" style="padding:20px"><strong class="red">注意：</strong>该文章暂未审核，审核后才会出现在官网！</p>
    </div>
    <% } %>

    <div class="article-head">
      <% if ( !member.username ) { %>
        <div class="article-head-user"><img src="/static/users/default-face.png" title="该用户消失了" /></div>
      <% } else { %>
        <div class="article-head-user"><a href="/user/<%= member._id %>" title="发布者：<%= member.username %>"><img src="/user/face/<%= member._id %>" /></a></div>
      <% } %>
      <div class="article-head-left">
        <h1 class="article-title"><%= article.title %></h1>
        <div class="article-type">
          <span class="article-channel"><a href="/article/<%= channel.url %>">[<%= channel.name %>]</a></span>
          <% if ( article.source ) { %>
            <% if ( article.sourceUrl ) { %>
              <span class="article-source">来源：<a href="<%= article.sourceUrl %>" target="_blank"><%= article.source %></a></span>
            <% } else { %>
              <span class="article-source">来源：<%= article.source %></span>
              <% } %>
          <% } %>
          <span class="article-click">人气：<%= article.click %></span>
          <span class="article-time"><%= moment(article.editDate).format('YYYY-MM-DD HH:mm:ss') %></span>
          <!-- <a href="#" class="article-collect">收藏</a> -->
          <a href="#comment" class="article-top-comment-link">评论：<span class="js-comment-count">-</span></a>
        </div>
      </div>
      <div class="article-head-right">
        <a href="#" class="article-top-zan">赞：<em><%= article.zan %></em></a>
        <div class="shareto">
          <div class="bdsharebuttonbox"><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣"></a></div>
        </div>
      </div>
    </div>
    <div id="js-description"><%= article.description %></div>
    <% if (!article.editorModel) { %>
    <div class="article-con" id="article-detail">
      <%- article.content %>
    </div>
    <% } %>
    <% if (article.editorModel) { %>
    <div class="article-con" id="article-detail">
      <p class="markdownShowLoading"><img src="/static/skin2015/img/loading.gif" />内容加载中...</p>
      <textarea id="editormd-con" style="display:none;"><%- article.content %></textarea>
    </div>
    <% } %>

    <a href="#" class="article-like"><span>icon</span>喜欢(<em><%= article.zan %></em>)</a>
    <% if ( article.tag ) { %>
    <% var tags = article.tag.split(",") %>
    <div class="article-tag" id="js-article-tag">标签：<% tags.forEach(function(tag){ %><a href="/tags/<%= tag %>"><%= tag %></a><% }) %></div>
    <% } %>

    <% if ( configIsComment && article.isComment ) { %>
    <!--  Comment  -->
    <div class="comment" id="js-comment">
      <h1>评论这篇文章</h1>
      <div class="comment-add">
        <% if ( user ) { %>
          <% if ( user.username.indexOf("@") > -1 ) { %>
            <div class="comment-not-login">先给自己一个昵称吧 <a href="/user/">点击设置昵称</a></div>
          <% } else { %>
            <a name="comment"></a>
            <form id="js-comment-form" name="comment-form" method="post">
              <input type="hidden" name="typeid" value="<%= article._id %>" />
              <input type="hidden" name="model" value="article" />
              <input type="hidden" name="title" value="<%= article.title %>" />
              <input type="hidden" name="privacy" value="0" />
              <div class="comment-form-box">
                <div class="comment-form-user"><img src="/user/face/<%=user._id %>" title="<%=user.username %>" /></div>
                <div class="comment-form-body">
                  <textarea name="content" placeholder="请输入评论内容，遵纪守法就是好公民！"></textarea>
                  <% if ( captcha && captcha === true ) { %>
                  <div class="comment-form-code"><input type="text" name="code" placeholder="验证码" /> <img id="code" src="/captcha/get" onclick="this.src +='?'+new Date().getTime(); return false;" title="点击刷新验证码" /></div>
                  <% } %>
                  <div class="comment-form-but">
                    <input type="submit" class="but-blue" name="button" value="提交" />
                  </div>
                </div>
              </div>
            </form>
          <% } %>
        <% } else { %>
          <a name="comment"></a>
          <div class="comment-not-login">
            只有WDShare成员才能发表评论。 <br />
            请 <a href="/user/login" onclick="if ( window.location.href.indexOf('referer') < 0 ) { window.location='/user/login?referer='+window.location.href; } else {window.location='/user/login?'+window.location.href.substring(window.location.href.indexOf('referer'));} return false;">登录</a> 或者 <a href="/user/register" onclick="if ( window.location.href.indexOf('referer') < 0 ) { window.location='/user/register?referer='+window.location.href; } else {window.location='/user/register?'+window.location.href.substring(window.location.href.indexOf('referer'));} return false;">注册</a> 后发表评论！
          </div>
        <% } %>
      </div>
      <div class="comment-list" id="js-comment-list">
        数据加载中...
      </div>
    </div>
    <!--  Comment End  -->
    <% } %>
  </div>
</div>

<% include ../../etc/foot.ejs %>
</body>
</html>